<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Correlator Class &mdash; SIMULATeQCD 0.7 documentation</title>
      <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
      <link rel="stylesheet" href="../_static/togglebutton.css" type="text/css" />
      <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/togglebutton.js"></script>
        <script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
        <script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
        <script>window.MathJax = {"options": {"processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script>
    <script src="../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Gauge Updates (HB and OR)" href="gaugeUpdates.html" />
    <link rel="prev" title="Inverter (Conjugate Gradient)" href="inverter.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #343131" >
            <a href="../index.html" class="icon icon-home"> SIMULATeQCD
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../01_gettingStarted/gettingStarted.html">Getting started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../02_contributions/contributions.html">Contributions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../03_applications/applications.html">Applications</a></li>
<li class="toctree-l1"><a class="reference internal" href="../04_codeBase/codeBase.html">Code base</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">Modules</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="inverter.html">Inverter (Conjugate Gradient)</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Correlator Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="gaugeUpdates.html">Gauge Updates (HB and OR)</a></li>
<li class="toctree-l2"><a class="reference internal" href="dslash.html">Dslash</a></li>
<li class="toctree-l2"><a class="reference internal" href="integrator.html">Integrator</a></li>
<li class="toctree-l2"><a class="reference internal" href="randomNumbers.html">Random Number Generator</a></li>
<li class="toctree-l2"><a class="reference internal" href="gaugeSmearing.html">HISQ smearing</a></li>
</ul>
</li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu"  style="background: #343131" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">SIMULATeQCD</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
          <li><a href="modules.html">Modules</a> &raquo;</li>
      <li>Correlator Class</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../_sources/05_modules/correlator.md.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section class="tex2jax_ignore mathjax_ignore" id="correlator-class">
<h1>Correlator Class<a class="headerlink" href="#correlator-class" title="Permalink to this headline"></a></h1>
<p>Here we explain the ideas behind and methods contained in the <code class="docutils literal notranslate"><span class="pre">Correlator</span></code> header file. The classes described here can be found
in <code class="docutils literal notranslate"><span class="pre">src/math/correlators.h</span></code>. If you have further questions after reading this wiki article, I suggest you have a look
at this class yourself, which is thoroughly commented, and will explain in more detail some things that are not fully explained here.</p>
<p>The main class is the <code class="docutils literal notranslate"><span class="pre">CorrelatorTools</span></code> class, <code class="docutils literal notranslate"><span class="pre">CorrelatorTools&lt;PREC,true,HaloDepth&gt;</span> <span class="pre">corrTools;</span></code> which contains all the
methods and attributes needed to correlate objects. What objects are to be correlated? These objects are called <code class="docutils literal notranslate"><span class="pre">CorrField</span></code> objects,
which are essentially arrays of arbitrary type that inherit from the <code class="docutils literal notranslate"><span class="pre">LatticeContainer</span></code> and include some initialization methods,
like the ability to set all elements to <code class="docutils literal notranslate"><span class="pre">zero()</span></code> or <code class="docutils literal notranslate"><span class="pre">one()</span></code>. Where are the results stored? Results are stored in objects
called <code class="docutils literal notranslate"><span class="pre">Correlator</span></code> objects, which are basically <code class="docutils literal notranslate"><span class="pre">CorrField</span></code> objects but indexed slightly differently.</p>
<p>You can correlate whatever kinds of mathematical objects <code class="docutils literal notranslate"><span class="pre">A</span></code> and <code class="docutils literal notranslate"><span class="pre">B</span></code> you like; for instance you could correlate Polyakov loops or
hadron interpolators. In order to give the user maximum flexibility, I tried to make the calculation of <code class="docutils literal notranslate"><span class="pre">A</span></code> and <code class="docutils literal notranslate"><span class="pre">B</span></code> separate
from the correlator class. Therefore the general idea of a correlation calculation is to calculate <code class="docutils literal notranslate"><span class="pre">A</span></code> and <code class="docutils literal notranslate"><span class="pre">B</span></code> ahead
of time yourself, then copy <code class="docutils literal notranslate"><span class="pre">A</span></code> and <code class="docutils literal notranslate"><span class="pre">B</span></code> into <code class="docutils literal notranslate"><span class="pre">CorrField</span></code> objects. What is meant by “correlate”? Well, that is up to you.
This framework will allow one to calculate any function <span class="math notranslate nohighlight">\(\langle f(A_x, B_y)\rangle\)</span>, where <span class="math notranslate nohighlight">\(f\)</span> is a function that you
can design yourself, and <span class="math notranslate nohighlight">\(x\)</span> and <span class="math notranslate nohighlight">\(y\)</span> run over one of a few possible <code class="docutils literal notranslate"><span class="pre">domains</span></code>. The method</p>
<div class="highlight-C++ notranslate"><div class="highlight"><pre><span></span><span class="n">corrTools</span><span class="p">.</span><span class="n">correlateAt</span><span class="o">&lt;</span><span class="w"> </span><span class="n">fieldType</span><span class="p">,</span><span class="w"> </span><span class="n">corrType</span><span class="p">,</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="o">&gt;</span><span class="p">(</span><span class="s">&quot;domain&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">CPUfield1</span><span class="p">,</span><span class="w"> </span><span class="n">CPUfield2</span><span class="p">,</span><span class="w"> </span><span class="n">CPUnorm</span><span class="p">,</span><span class="w"> </span><span class="n">CPUcorr</span><span class="p">);</span><span class="w"></span>
</pre></div>
</div>
<p>will carry out this correlator calculation. Here <code class="docutils literal notranslate"><span class="pre">fieldType</span></code> and <code class="docutils literal notranslate"><span class="pre">corrType</span></code> are the types of the <code class="docutils literal notranslate"><span class="pre">CorrField</span></code> and <code class="docutils literal notranslate"><span class="pre">Correlator</span></code>,
respectively. Note that your function <span class="math notranslate nohighlight">\(f\)</span> is implemented as a template parameter. Inside the <code class="docutils literal notranslate"><span class="pre">correlateAt</span></code> method, a kernel
is called depending on the <code class="docutils literal notranslate"><span class="pre">domain</span></code> you chose. In this method, GPU copies of these CPU arrays will be made and passed to the kernel.
The result will be stored in <code class="docutils literal notranslate"><span class="pre">CPUcorr</span></code>.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">CPUnorm</span></code> vector is a <code class="docutils literal notranslate"><span class="pre">Correlator</span></code>-type object that keeps track of how many times a correlator at distance <span class="math notranslate nohighlight">\(r\)</span> was calculated.
This is something that you should pre-calculate ahead of time using <code class="docutils literal notranslate"><span class="pre">corrTools.createNorm</span></code>; the result will be saved in a normalization
file that you can load later in your production runs. This is not particularly elegant, and <code class="docutils literal notranslate"><span class="pre">createNorm</span></code> runs on the CPU only so it’s
rather slow. One can think of a more elegant way to implement this or a way to speed it up. Nevertheless this procedure works, and after
reading in with <code class="docutils literal notranslate"><span class="pre">corrTools.readNorm</span></code>, the correlator calculation seems to be rather fast. (See the benchmarking below for details.)</p>
<section id="example-correlator-calculation">
<h2>Example correlator calculation<a class="headerlink" href="#example-correlator-calculation" title="Permalink to this headline"></a></h2>
<p>Here is an example taken from <code class="docutils literal notranslate"><span class="pre">src/testing/main_correlatorTest.cpp</span></code>. In this example we will correlate the <span class="math notranslate nohighlight">\(\mu=2\)</span> component of a
gauge field with itself using the 4d all-to-all domain. Here <span class="math notranslate nohighlight">\(f(A,B)={\rm tr}~(AB)\)</span>.</p>
<div class="highlight-C++ notranslate"><div class="highlight"><pre><span></span><span class="n">gaugeAccessor</span><span class="o">&lt;</span><span class="n">PREC</span><span class="o">&gt;</span><span class="w"> </span><span class="n">_gauge</span><span class="p">(</span><span class="n">gauge</span><span class="p">.</span><span class="n">getAccessor</span><span class="p">());</span><span class="w"></span>

<span class="n">CorrField</span><span class="o">&lt;</span><span class="nb">false</span><span class="p">,</span><span class="n">SU3</span><span class="o">&lt;</span><span class="n">PREC</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="n">CPUfield1</span><span class="p">(</span><span class="n">commBase</span><span class="p">,</span><span class="w"> </span><span class="n">corrTools</span><span class="p">.</span><span class="n">vol4</span><span class="p">);</span><span class="w"></span>
<span class="n">CorrField</span><span class="o">&lt;</span><span class="nb">false</span><span class="p">,</span><span class="n">SU3</span><span class="o">&lt;</span><span class="n">PREC</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="n">CPUfield2</span><span class="p">(</span><span class="n">commBase</span><span class="p">,</span><span class="w"> </span><span class="n">corrTools</span><span class="p">.</span><span class="n">vol4</span><span class="p">);</span><span class="w"></span>
<span class="n">Correlator</span><span class="o">&lt;</span><span class="nb">false</span><span class="p">,</span><span class="n">PREC</span><span class="o">&gt;</span><span class="w"> </span><span class="n">CPUnorm</span><span class="p">(</span><span class="n">commBase</span><span class="p">,</span><span class="w"> </span><span class="n">corrTools</span><span class="p">.</span><span class="n">UAr2max</span><span class="p">);</span><span class="w"></span>
<span class="n">Correlator</span><span class="o">&lt;</span><span class="nb">false</span><span class="p">,</span><span class="n">COMPLEX</span><span class="p">(</span><span class="n">PREC</span><span class="p">)</span><span class="o">&gt;</span><span class="w"> </span><span class="n">CPUcorrComplex</span><span class="p">(</span><span class="n">commBase</span><span class="p">,</span><span class="w"> </span><span class="n">corrTools</span><span class="p">.</span><span class="n">UAr2max</span><span class="p">);</span><span class="w"></span>

<span class="k">for</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">m</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">m</span><span class="o">&lt;</span><span class="n">corrTools</span><span class="p">.</span><span class="n">vol4</span><span class="p">;</span><span class="w"> </span><span class="n">m</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">_CPUfield3</span><span class="p">.</span><span class="n">setValue</span><span class="p">(</span><span class="n">m</span><span class="p">,</span><span class="w"> </span><span class="n">_gauge</span><span class="p">.</span><span class="n">getLink</span><span class="p">(</span><span class="n">GInd</span><span class="o">::</span><span class="n">getSiteMu</span><span class="p">(</span><span class="n">m</span><span class="p">,</span><span class="mi">2</span><span class="p">)));</span><span class="w"></span>
<span class="w">    </span><span class="n">_CPUfield4</span><span class="p">.</span><span class="n">setValue</span><span class="p">(</span><span class="n">m</span><span class="p">,</span><span class="w"> </span><span class="n">_gauge</span><span class="p">.</span><span class="n">getLink</span><span class="p">(</span><span class="n">GInd</span><span class="o">::</span><span class="n">getSiteMu</span><span class="p">(</span><span class="n">m</span><span class="p">,</span><span class="mi">2</span><span class="p">)));</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="n">corrTools</span><span class="p">.</span><span class="n">correlateAt</span><span class="o">&lt;</span><span class="n">SU3</span><span class="o">&lt;</span><span class="n">PREC</span><span class="o">&gt;</span><span class="p">,</span><span class="n">COMPLEX</span><span class="p">(</span><span class="n">PREC</span><span class="p">),</span><span class="n">AxB</span><span class="o">&lt;</span><span class="n">PREC</span><span class="o">&gt;&gt;</span><span class="p">(</span><span class="s">&quot;spacetime&quot;</span><span class="p">,</span><span class="w"> </span><span class="n">CPUfield1</span><span class="p">,</span><span class="w"> </span><span class="n">CPUfield2</span><span class="p">,</span><span class="w"> </span><span class="n">CPUnorm</span><span class="p">,</span><span class="w"> </span><span class="n">CPUcorrComplex</span><span class="p">,</span><span class="w"> </span><span class="n">XYswapSymmetry</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">false</span><span class="p">);</span><span class="w"></span>
</pre></div>
</div>
<p>Here, we have set sizes with <code class="docutils literal notranslate"><span class="pre">vol4</span></code>, i.e. <span class="math notranslate nohighlight">\(N_s^3\times N_\tau\)</span>, and <code class="docutils literal notranslate"><span class="pre">UAr2max</span></code>, which is the largest 4d squared separation possible,
given periodic BCs. <code class="docutils literal notranslate"><span class="pre">UA</span></code> stands for “unrestricted all”; this is opposed to “restricted” (<code class="docutils literal notranslate"><span class="pre">R</span></code>) domains that do not include all possible
spacetime pairs, and “spatial” (<code class="docutils literal notranslate"><span class="pre">S</span></code>) domains, which only compute spatial pairs. The <code class="docutils literal notranslate"><span class="pre">XYswapSymmetry</span></code> flag is <code class="docutils literal notranslate"><span class="pre">true</span></code> if the correlator
is insensitive to interchange of <span class="math notranslate nohighlight">\(x\)</span> and <span class="math notranslate nohighlight">\(y\)</span>, which can happen for example for some Polyakov loop correlators. Setting this
flag to <code class="docutils literal notranslate"><span class="pre">true</span></code> may decrease computation time by as much as 70% (see the benchmarking below for details). If you aren’t sure what to do,
just leave it as <code class="docutils literal notranslate"><span class="pre">false</span></code>.</p>
</section>
<section id="singlet-octet-and-average-polyakov-loop-correlators">
<h2>Singlet, octet, and average Polyakov loop correlators<a class="headerlink" href="#singlet-octet-and-average-polyakov-loop-correlators" title="Permalink to this headline"></a></h2>
<p>This section contains code meant only for constructing certain Polyakov loop correlators. It was implemented by porting C code written
by Olaf Kaczmarek into SIMULATeQCD and therefore is not utilizing the <code class="docutils literal notranslate"><span class="pre">Correlator</span></code> class fully. In principle these could be implemented
in the future with the <code class="docutils literal notranslate"><span class="pre">Correlator</span></code> class. Instead, the following methods, part of the more specific <code class="docutils literal notranslate"><span class="pre">polyakovLoopCorrelator</span></code> class,
can be found in <code class="docutils literal notranslate"><span class="pre">src/modules/gaugeFixing</span></code>. One can instantiate this class with, e.g.
<code class="docutils literal notranslate"><span class="pre">polyakovLoopCorrelator&lt;PREC,true,HaloDepth&gt;</span> <span class="pre">PLC(gauge)</span></code> Various correlators can be constructed from untraced Polyakov
loops. Three examples include the singlet, octet, and average. Some useful information about these correlators can be
found <a class="reference external" href="https://doi.org/10.1103/PhysRevD.24.450">here</a>, <a class="reference external" href="https://doi.org/10.1103/PhysRevD.33.3738">here</a>,
and <a class="reference external" href="https://doi.org/10.1103/PhysRevD.34.3904">here</a>. The <code class="docutils literal notranslate"><span class="pre">polyakovLoopCorrelator</span></code> class includes a function to
compute these correlators, which can be obtained with the following snippet of code:</p>
<div class="highlight-C++ notranslate"><div class="highlight"><pre><span></span><span class="k">const</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">distmax</span><span class="o">=</span><span class="n">corrTools</span><span class="p">.</span><span class="n">distmax</span><span class="p">;</span><span class="w"></span>
<span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">PREC</span><span class="o">&gt;</span><span class="w"> </span><span class="n">vec_plca</span><span class="p">(</span><span class="n">distmax</span><span class="p">);</span><span class="w"></span>
<span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">PREC</span><span class="o">&gt;</span><span class="w"> </span><span class="n">vec_plc1</span><span class="p">(</span><span class="n">distmax</span><span class="p">);</span><span class="w"></span>
<span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">PREC</span><span class="o">&gt;</span><span class="w"> </span><span class="n">vec_plc8</span><span class="p">(</span><span class="n">distmax</span><span class="p">);</span><span class="w"></span>
<span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;</span><span class="w">  </span><span class="n">vec_factor</span><span class="p">(</span><span class="n">distmax</span><span class="p">);</span><span class="w"></span>
<span class="n">vec_factor</span><span class="o">=</span><span class="n">corrTools</span><span class="p">.</span><span class="n">getFactorArray</span><span class="p">();</span><span class="w"></span>
<span class="n">corrTools</span><span class="p">.</span><span class="n">PLCtoArrays</span><span class="p">(</span><span class="n">vec_plca</span><span class="p">,</span><span class="w"> </span><span class="n">vec_plc1</span><span class="p">,</span><span class="w"> </span><span class="n">vec_plc8</span><span class="p">);</span><span class="w"></span>
</pre></div>
</div>
<p>The first line grabs <code class="docutils literal notranslate"><span class="pre">distmax</span></code><span class="math notranslate nohighlight">\(=N_s^2/4+1\)</span> so that the resultant vectors <code class="docutils literal notranslate"><span class="pre">vec_*</span></code> have the correct size. The vectors are indexed by
squared distance <span class="math notranslate nohighlight">\(r^2\)</span>. Some squared separations are not possible on a lattice in 3D; for example <span class="math notranslate nohighlight">\(r^2=7\)</span> is not allowed. Therefore several
of the entries will be zero. The resultant vectors are normalized inside <code class="docutils literal notranslate"><span class="pre">PLCtoArrays</span></code> by <code class="docutils literal notranslate"><span class="pre">vec_factor</span></code>, which counts the number of contributions
to each correlator at a particular <span class="math notranslate nohighlight">\(r^2\)</span>. Hence, <code class="docutils literal notranslate"><span class="pre">vec_factor[r2]==0</span></code> for every disallowed distance. <em>NOTE:</em> <code class="docutils literal notranslate"><span class="pre">getFactorArray</span></code> must be called
before <code class="docutils literal notranslate"><span class="pre">PLCtoArrays</span></code>, as <code class="docutils literal notranslate"><span class="pre">getFactorArray</span></code> also initializes the factor array. This initialization routine gives back <code class="docutils literal notranslate"><span class="pre">vec_factor</span></code> because it
can be used, for example, if you want to write to file the correlators at allowed distances only. For instance one accomplishes this for
the average channel with</p>
<div class="highlight-C++ notranslate"><div class="highlight"><pre><span></span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">r2</span><span class="o">=</span><span class="mi">0</span><span class="w"> </span><span class="p">;</span><span class="w"> </span><span class="n">r2</span><span class="o">&lt;</span><span class="n">distmax</span><span class="w"> </span><span class="p">;</span><span class="w"> </span><span class="n">r2</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">vec_factor</span><span class="p">[</span><span class="n">r2</span><span class="p">]</span><span class="o">&gt;</span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">commBase</span><span class="p">.</span><span class="n">MyRank</span><span class="p">()</span><span class="o">==</span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="n">plcresultfile</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">setw</span><span class="p">(</span><span class="mi">7</span><span class="p">)</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">dx</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="s">&quot;  &quot;</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">setw</span><span class="p">(</span><span class="mi">13</span><span class="p">)</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">scientific</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">vec_plca</span><span class="p">[</span><span class="n">r2</span><span class="p">]</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>
</div>
<p><strong>NOTE:</strong> The singlet and octet Polyakov loop correlations depend on the gauge, and in particular, they should be measured in the Coulomb gauge.
This means you must fix the gauge before measuring these quantities! Do learn how to do this, please have a look at the <a class="reference internal" href="../03_applications/gaugeFixing.html"><span class="doc std std-doc">gauge fixing</span></a>
page. Don’t forget to re-unitarize before taking your measurements! The singlet, octet, and average correlators are tested in <code class="docutils literal notranslate"><span class="pre">src/testing/main_gfixplcTest.cpp</span></code>.</p>
</section>
<section id="some-benchmarks">
<h2>Some benchmarks:<a class="headerlink" href="#some-benchmarks" title="Permalink to this headline"></a></h2>
<p>This table shows results for the 4d all-to-all tested on NVIDIA Pascal GPUs. This is the time it takes to multiply two <code class="docutils literal notranslate"><span class="pre">SU3</span></code> identity matrices with themselves,
which is a good estimate for how long it takes to correlate two <code class="docutils literal notranslate"><span class="pre">CorrFields</span></code> of type <code class="docutils literal notranslate"><span class="pre">SU3</span></code> on the lattices of the given size. For reference, 1 minute is 60 000 ms.</p>
<p><strong>Symmetric Results:</strong></p>
<table class="colwidths-auto docutils align-default">
<thead>
<tr class="row-odd"><th class="text-align:left head"><p><span class="math notranslate nohighlight">\(N_s\)</span></p></th>
<th class="head"><p><span class="math notranslate nohighlight">\(N_\tau\)</span></p></th>
<th class="head"><p>UA id3 x id3 [ms]</p></th>
<th class="text-align:right head"><p>US id3 x id3 [ms]</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td class="text-align:left"><p>8</p></td>
<td><p>4</p></td>
<td><p>12</p></td>
<td class="text-align:right"><p>5</p></td>
</tr>
<tr class="row-odd"><td class="text-align:left"><p>24</p></td>
<td><p>6</p></td>
<td><p>3240</p></td>
<td class="text-align:right"><p>78</p></td>
</tr>
<tr class="row-even"><td class="text-align:left"><p>24</p></td>
<td><p>8</p></td>
<td><p>5474</p></td>
<td class="text-align:right"><p>78</p></td>
</tr>
<tr class="row-odd"><td class="text-align:left"><p>20</p></td>
<td><p>20</p></td>
<td><p>9708</p></td>
<td class="text-align:right"><p>48</p></td>
</tr>
<tr class="row-even"><td class="text-align:left"><p>32</p></td>
<td><p>6</p></td>
<td><p>15306</p></td>
<td class="text-align:right"><p>470</p></td>
</tr>
<tr class="row-odd"><td class="text-align:left"><p>32</p></td>
<td><p>8</p></td>
<td><p>25473</p></td>
<td class="text-align:right"><p>469</p></td>
</tr>
<tr class="row-even"><td class="text-align:left"><p>40</p></td>
<td><p>8</p></td>
<td><p>96564</p></td>
<td class="text-align:right"><p>1901</p></td>
</tr>
<tr class="row-odd"><td class="text-align:left"><p>48</p></td>
<td><p>6</p></td>
<td><p>172147</p></td>
<td class="text-align:right"><p>5170</p></td>
</tr>
<tr class="row-even"><td class="text-align:left"><p>48</p></td>
<td><p>8</p></td>
<td><p>285101</p></td>
<td class="text-align:right"><p>5174</p></td>
</tr>
<tr class="row-odd"><td class="text-align:left"><p>42</p></td>
<td><p>12</p></td>
<td><p>270474</p></td>
<td class="text-align:right"><p>2420</p></td>
</tr>
<tr class="row-even"><td class="text-align:left"><p>48</p></td>
<td><p>12</p></td>
<td><p>594554</p></td>
<td class="text-align:right"><p>5183</p></td>
</tr>
<tr class="row-odd"><td class="text-align:left"><p>56</p></td>
<td><p>8</p></td>
<td><p>732532</p></td>
<td class="text-align:right"><p>13296</p></td>
</tr>
</tbody>
</table>
<p><strong>Asymmetric Results:</strong></p>
<table class="colwidths-auto docutils align-default">
<thead>
<tr class="row-odd"><th class="text-align:left head"><p><span class="math notranslate nohighlight">\(N_s\)</span></p></th>
<th class="head"><p><span class="math notranslate nohighlight">\(N_\tau\)</span></p></th>
<th class="head"><p>UA id3 x id3 [ms]</p></th>
<th class="text-align:right head"><p>US id3 x id3 [ms]</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td class="text-align:left"><p>8</p></td>
<td><p>4</p></td>
<td><p>15</p></td>
<td class="text-align:right"><p>5</p></td>
</tr>
<tr class="row-odd"><td class="text-align:left"><p>24</p></td>
<td><p>6</p></td>
<td><p>4027</p></td>
<td class="text-align:right"><p>97</p></td>
</tr>
<tr class="row-even"><td class="text-align:left"><p>24</p></td>
<td><p>8</p></td>
<td><p>6746</p></td>
<td class="text-align:right"><p>96</p></td>
</tr>
<tr class="row-odd"><td class="text-align:left"><p>20</p></td>
<td><p>20</p></td>
<td><p>13410</p></td>
<td class="text-align:right"><p>47</p></td>
</tr>
<tr class="row-even"><td class="text-align:left"><p>32</p></td>
<td><p>6</p></td>
<td><p>22265</p></td>
<td class="text-align:right"><p>633</p></td>
</tr>
<tr class="row-odd"><td class="text-align:left"><p>32</p></td>
<td><p>8</p></td>
<td><p>37821</p></td>
<td class="text-align:right"><p>632</p></td>
</tr>
<tr class="row-even"><td class="text-align:left"><p>40</p></td>
<td><p>8</p></td>
<td><p>155048</p></td>
<td class="text-align:right"><p>2465</p></td>
</tr>
<tr class="row-odd"><td class="text-align:left"><p>48</p></td>
<td><p>6</p></td>
<td><p>283987</p></td>
<td class="text-align:right"><p>8014</p></td>
</tr>
<tr class="row-even"><td class="text-align:left"><p>48</p></td>
<td><p>8</p></td>
<td><p>476607</p></td>
<td class="text-align:right"><p>8016</p></td>
</tr>
<tr class="row-odd"><td class="text-align:left"><p>42</p></td>
<td><p>12</p></td>
<td><p>448504</p></td>
<td class="text-align:right"><p>3896</p></td>
</tr>
<tr class="row-even"><td class="text-align:left"><p>48</p></td>
<td><p>12</p></td>
<td><p>1007574</p></td>
<td class="text-align:right"><p>8012</p></td>
</tr>
<tr class="row-odd"><td class="text-align:left"><p>56</p></td>
<td><p>8</p></td>
<td><p>1239982</p></td>
<td class="text-align:right"><p>18401</p></td>
</tr>
</tbody>
</table>
</section>
</section>


           </div>
          </div>
          <footer>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2021, LatticeQCD.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>